package ins.wink.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ins.wink.entity.Store;
import ins.wink.mapper.StoreMapper;
import ins.wink.service.StoreService;

/**
 * 仓库service接口实现层
 */
@Service
@Transactional
public class StoreServiceImpl implements StoreService {
	//注册仓库mapper层
	@Autowired
	private StoreMapper storeService;
	
	//查询
	@Override
	public List<Store> storeAlls() {
		List<Store> list = storeService.storeAll();
		return list;
	}
	//查询
	@Override
	public Store listStoreIds(String id) {
		Store store = storeService.listStoreId(id);
		return store;
	}
	//修改
	@Override
	public void updateStores(Store store) {
		storeService.updateStore(store);
	}
	//删除
	@Override
	public void stroedeletes(String id) {
		storeService.stroedelete(id);
	}
	//根据仓库名查询
	@Override
	public Store selectStoreName(String name) {
		Store store = storeService.selectStoreName(name);
		//判断
		if(store==null) {
			return null;
		}
		return store;
	}
	//添加
	@Override
	public void insertStores(Store store) {
		storeService.insertStore(store);
	}

}
